Internationalization is a process of enabling a program (e.g., Java™) to run internationally. That is, an internationalized program has the flexibility to run correctly in any country. An internationalized program must be able to read, write and manipulate localized text. Furthermore, an internationalized program must conform to local customs when displaying dates and times, formatting numbers and sorting strings.
Internationalization is becoming increasingly important with the explosive growth of the Internet and the World Wide Web where an ever increasing number of computer users are from various locales. A locale represents a geographic, cultural or political region. One of the problems with internationalization involves the use of text strings that may be hard-coded in the program. “Hard-coded text strings” may refer to text that will not vary with the locale. That is, the text strings may appear in English even when the program is run on the French locale. Various object-oriented languages, such as Java™, have developed tools to assist in developing internationalized programs and allowing text strings to appear in the language of the locale.
One such tool is the use of resource files, commonly referred to in Java™ as “resource bundles.” A resource bundle class may be used for externalizing text strings (i.e., messages). By externalizing text strings, appropriate text strings appear in the language of the locale. The resource bundle class is an associative array of keys and values. Keys are free formatted strings that appear in the program code as well as in the resource bundle thereby allowing the program to access the externalized string. Externalized strings may be represented as a value associated with the key. That is, appropriate text strings for a given locale are indexed by keys. For example, a resource bundle associated with an English locale, may include the key of “File Menu” and an associated value of “File.” The value associated with the key of “File Menu” is a text string of “File” which appears to the user. In a French locale, however, the text string of “File” is replaced with the term “fichier” in a separate resource file associated with the French locale. By having resource bundles associated with particular locales (e.g., a resource file with resources associated with the U.S. English locale, a resource file with resources associated with the French locale and so forth), appropriate text strings associated with the particular locale may be loaded at runtime.
To aid in determining the correlated term across the various locales (i.e., across various languages), a new, unique key (referred to herein as a “language independent key”) may be generated. For example, the text string of “hello” in the English locale is equivalent to the text string of “hola” in the Spanish locale. A language independent key along with the text strings of “hello” and “hola” may be saved in a table in the English and Spanish locales thereby quickly ascertaining the equivalent term across the locales based on the language independent key.
The language independent key may be generated using many formulas as described in U.S. patent application entitled “System and Method to Facilitate Automatic Globalization Verification Test-File Scanner,” Ser. No. 11/828,459, filed on Jul. 26, 2007, which is hereby incorporated herein in its entirety by reference. Once the language independent key is generated, it is appended to a table associated with a locale (e.g., English locale, Japanese locale) along with the string values (i.e., text strings) in various locales associated with the language independent key generated. For example, referring to FIG. 1, FIG. 1 illustrates a locale table 101 that stores various language independent keys 102 along with their associated English (“en”) 103 and Japanese (“ja”) 104 text strings. For instance, language independent key wp.ui.war$engine@link.login 105 is associated with the English text string of “login” and the equivalent Japanese text string. Language independent key pdm.war$pdmportlet.xml@pdm_portlet.title 106 is associated with the English text string of “Document Manager” and the equivalent Japanese text string. Further, language independent key wp.ac.api.jar$AccessMessages@LOAD_ERROR 107 is associated with the English text string of “An Error Occurred” and the equivalent Japanese text string.
Often, multiple language independent keys may be associated with the same text string. For example, multiple language independent keys may be associated with the English term “hello” as there may be multiple ways of saying “hello” in a different language. For example, “hello” in English may be equivalent to “moshimoshi” or “osero” or “konichiwa” in Japanese. Hence, in this example, there may be at least three language independent keys associated with the English term “hello” as well as associated with different equivalent text strings in another language.
Several software testing applications have been developed to test the effectiveness of software programs during the development of these software programs. These software testing applications typically allow a user to test a software program by allowing the user to prepare test scripts. Test scripts may refer to programs used to test part of the functionality of a software system. In the case of testing internationalized programs, these test scripts are used to test the effectiveness of the internationalization in internationalized programs. These type of test scripts may perform a test, commonly referred to as a “Globalization Verification Test.” For example, the Globalization Verification Test may include testing the effectiveness of the software program to handle a non-English environment. For instance, the Globalization Verification Test may encounter the number of text strings that are hard-coded and are not translated in other locales.
In performing the Globalization Verification Test, a test script may extract and insert the information from these locale tables (e.g., language independent keys and associated text strings in various languages) into one large file, referred to herein as a “properties file.” To determine the effectiveness of the internationalized program, a script writer (referring to the programmer of the test script) may manually search these language independent keys for unique language independent keys (discussed in further detail below) to be used in the test script to test the internationalized program. A script writer may want to use these language independent keys in a test script in order to execute the test script in various locales. Test scripts are typically written in a single language by script writers who hard code their text strings. Hence, these test scripts cannot be executed in a different locale (e.g., English script cannot be executed in a Japanese locale). Hence, by incorporating these language independent keys in the test script, the test script may be executed in multiple locales.
As discussed above, there may be multiple language independent keys associated with a single text string. Hence, the script writer may have to be knowledgeable of the uses of the same term in a different language in order to select the appropriate language independent key that is associated with the correct terms to be used. The appropriate language independent key may be referred to herein as the “unique language independent key.”
As stated above, currently, the script writer manually searches through the language independent keys in the properties file to identify the unique language independent keys to use. The script writer further manually determines if the text strings associated with the language independent keys for the various locales are correct. Having incorrect text strings may be referred to as “translation issues.” The script writer may also manually determine if there are any missing text strings in association with the language independent key. This may be referred to as “translatability issues.”
For example, referring to FIG. 2, properties file 201 may be generated which includes a listing of language independent keys 202 and associated values or text strings across various locales (English is designated as “en” 203; Japanese is designated as “ja” 204; German is designated as “de” 205; and Ukrainian is designated as “uk” 206). In obtaining the unique language independent key, the script writer may manually enter a value (e.g., text string of “log in”) in one of the locales (e.g., English locale). A listing of language independent keys 202 from properties file 201 may appear to the script writer. Since there are multiple language independent keys 202 (five in this example) associated with the English text string of “log in,” the script writer further manually enters the translated term of “log in” to be used in the other locales (e.g., Japanese, German and Ukrainian) and receives a listing of language independent keys 202 associated with the entered text strings. The script writer manually selects one of the displayed number of language independent keys 202 that is common among the language independent keys displayed for the entered text strings across the locales. In the example illustrated in FIG. 2, the unique language independent key that is associated with the appropriate text strings of “log in” across the locales of English, Japanese, German and Ukrainian is selfcare.war$selfcareportlet@selfcare.button.login. During the process of selecting the unique language independent key, the script writer reviews the text strings to ensure they are correct as well as to ensure there are text strings in the appropriate languages associated with the language independent key.
By manually searching these language independent keys to identify a unique language independent key and determining if there are translation or translatability issues, the process is time-consuming and inefficient. Further, most script writers are not proficient in various foreign languages and do not have the knowledge to identify the correct language independent key or to determine or correct the translation and translatability issues.
Therefore, there is a need in the art to aid the script writer by automatically identifying unique language independent keys associated with particular text strings of various locales.